package cn.silver.module.system.service.impl;


import cn.silver.framework.mybatis.service.impl.BaseServiceImpl;
import cn.silver.module.system.bean.WebsiteBean;
import cn.silver.module.system.domain.SysWebsite;
import cn.silver.module.system.mapper.SysWebsiteMapper;
import cn.silver.module.system.param.WebsiteParam;
import cn.silver.module.system.service.ISysWebsiteService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.Collection;

/**
 * 常用网址Service业务层处理
 *
 * @author Silver.Zhou
 */
@Service
public class SysWebsiteServiceImpl extends BaseServiceImpl<SysWebsiteMapper, SysWebsite, WebsiteParam, WebsiteBean>
        implements ISysWebsiteService {

    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public void initWebsite(String userId) {

    }

    @Override
    @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
    public void deleteByUserId(Collection<String> userIds) {
        this.baseMapper.delete(new LambdaQueryWrapper<SysWebsite>().in(SysWebsite::getUserId, userIds));
    }
}
